<?php
namespace app\admin\validate;

use think\Validate;

class GoodsValidate extends Validate
{
    protected $rule = [
        'cid'            => 'require',
        'g_name'         => 'require',
        'g_unit'         => 'require',
        'g_cprice'       => 'require|number',
        'g_oprice'       => 'require|number',
        'g_description'  => 'require',
        'g_content'      => 'require'
    ];

    protected $message = [
        'cid.require'             => '请选择商品类型',
        'g_name.require'          => '商品名称不能为空',
        'g_unit.require'          => '数量的单位不能为空',
        'g_cprice.require'        => '当前价不能为空',
        'g_cprice.number'         => '当前价必须为数字',
        'g_oprice.require'        => '原价不能为空',
        'g_oprice.number'         => '原价必须为数字',
        'g_description.require'   => '商品描述不能为空',
        'g_content.require'       => '商品信息不能为空'
    ];
}